<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="cn.ml.web3.dao.StudentDao" %>
<%@ page import="cn.ml.web3.dao.StudentDaoImpl" %>
<%@ page import="cn.ml.web3.entity.Student" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String idstr = request.getParameter("id");
    StudentDao dao = new StudentDaoImpl();
    Student student = dao.get(Integer.parseInt(idstr));

    /*String sql = "select * from xueyuan2 where id = "+idstr;
    Class.forName("com.mysql.jdbc.Driver");
    String url = "jdbc:mysql://localhost:3306/myschool2";
    String user = "root";
    String pwd = "root";
    Connection conn = DriverManager.getConnection(url,user,pwd);
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery(sql);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
    if(rs.next()){
        String bornday2 = sdf.format(rs.getTime("bornday"));

     */
        %>
<h3>你保存的信息如下</h3>
ID:<%=student.getId()%>
name:<%=student.getName()%>
gender:<%=student.getGender()%>
bornday:<%=student.getBornday()%>


<%--ID:<%=rs.getInt("id")%>
name:<%=rs.getString("name")%>
gender:<%=rs.getString("gender")%>
bornday:<%=bornday2%><br/>--%>
<br/>
<%--<%
    }else {
        %>
<%=idstr%>的学员不存在
<%
    }
%>--%>
<br>
<a href="addStudent.jsp">添加学员</a> | <a href="listStudent.jsp">查看学员</a>
<%--<jsp:include page="header.jsp"></jsp:include>
<a href="addStudent.jsp">添加学员</a> | <a href="listStudent.jsp">查看学员</a>--%>
</body>
</html>
